<extend name="./base" />
<block name="title"><?php echo $_SESSION['username'] ?></block>
<block name="body">
	<div>
		<a href="/Bailey/index.php/Home/Course/courseadd">添加课程</a>|<a href="/Bailey/index.php/Home/Course/courselist">课程管理</a>
	</div>
<form class="form-horizontal" method="post">
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
    <div class="col-sm-10">
      <input type="text" disabled="true" class="form-control" name="username" id="inputEmail3" value="{$teacher.username}" placeholder="用户名">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
    <div class="col-sm-10">
      <input type="email" disabled="true" name="email" class="form-control"  value="{$teacher.email}" placeholder="邮箱">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">真实姓名</label>
    <div class="col-sm-10">
      <input type="text" name="relname" class="form-control"  value="{$teacher.relname}" placeholder="真实姓名">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">手机</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="phone" value="{$teacher.phone}" placeholder="手机">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">生日</label>
    <div class="col-sm-10">
      <input type="date" class="form-control" name="birthday" value="{$teacher.birthday}" placeholder="生日">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">所在地点</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="address" value="{$teacher.address}" placeholder="地点">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">毕业学校</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="school" value="{$teacher.school}" placeholder="毕业学校">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">所教年级</label>
    <div class="col-sm-10">
      <label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="学前"> 学前
	  </label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="一年级"> 一年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="二年级"> 二年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="三年级"> 三年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="四年级"> 四年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="五年级"> 五年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="六年级"> 六年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="七年级"> 七年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="八年级"> 八年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="九年级"> 九年级
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="高一"> 高一
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="高二"> 高二
		</label>
		<label class="checkbox-inline">
		  <input type="checkbox" name="grade" value="高三"> 高三
		</label>
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">教龄</label>
    <div class="col-sm-10">
      <input type="number" class="form-control" name="teachage" value="{$teacher.teachage}" placeholder="教龄">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">所属机构</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="organization" value="{$teacher.organization}" placeholder="所属机构">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">头像</label>
    <div class="col-sm-2">
      <input type="file" id="fileElem" multiple accept="image/*"  onchange="handleFiles(this)" class="form-control" value="" placeholder="所属机构">
    </div>
    <div class="col-sm-8">
      <div id="fileList">
      	
      </div>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">确认修改</button>
    </div>
  </div>
</form>
</block>
<block name="myjs">
<script>
	window.URL = window.URL || window.webkitURL;
	var fileElem = document.getElementById("fileElem"),
	    fileList = document.getElementById("fileList");
	function handleFiles(obj) {
		var files = obj.files,
			img = new Image();
		if(window.URL){
			//File API
			  alert(files[0].name + "," + files[0].size + " bytes");
		      img.src = window.URL.createObjectURL(files[0]); //创建一个object URL，并不是你的本地路径
		      img.width = 200;
		      img.onload = function(e) {
		         window.URL.revokeObjectURL(this.src); //图片加载后，释放object URL
		      }
		      fileList.appendChild(img);
		}else if(window.FileReader){
			//opera不支持createObjectURL/revokeObjectURL方法。我们用FileReader对象来处理
			var reader = new FileReader();
			reader.readAsDataURL(files[0]);
			reader.onload = function(e){
				alert(files[0].name + "," +e.total + " bytes");
				img.src = this.result;
				img.width = 200;
				fileList.appendChild(img);
			}
		}else{
			//ie
			obj.select();
			obj.blur();
			var nfile = document.selection.createRange().text;
			document.selection.empty();
			img.src = nfile;
			img.width = 200;
			img.onload=function(){
		      alert(nfile+","+img.fileSize + " bytes");
		    }
			fileList.appendChild(img);
			//fileList.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image',src='"+nfile+"')";
		}
	}
</script>	
</block>